///////////////////////////////////////////////////////////////////////////
// Copyright 2009 Arabic Game Developer Network, All rights reserved
// www.agd-online.com - info@agdn-online.com
//
// File: sdleventmanager.cpp
// Description:
//
///////////////////////////////////////////////////////////////////////////

// This file is part of kvalleyX.
// 
// kvalleyX is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// kvalleyX is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with kvalleyX.  If not, see <http://www.gnu.org/licenses/>.

#include "sdleventmanager.h"
#include <iostream>
namespace CoreLib
{
	
void SDLEventManager::init()
{
}


// EventManager::EventType SDLEventManager::pollEvents()
// {
// 	SDL_PollEvent(&mEvent);
// 	switch(mEvent.type)
// 	{
// 		case SDL_QUIT:
// 			return EventManager::QUIT;
// 		case SDL_KEYDOWN:
// 			if(mEvent.key.keysym.sym == SDLK_ESCAPE)
// 				return EventManager::QUIT;
// 			else return EventManager::KEYDOWN;
// 	}
// }

// void SDLEventManager::getKeyEvent(InputManager const *inputManagerPtr)
// {
// 	if(!inputManagerPtr)
// 	{
// 		std::cerr << "Invalid inputManager pointer" << std::endl;
// 		return;
// 	}
// 	//inputMangaterPtr->
// }

bool SDLEventManager::isQuit()
{
	SDL_Event    event;
	while(SDL_PollEvent(&event))
	{	
		if(event.type == SDL_QUIT)
			return true;
	}
	return false;
}

} // namespace Co reLib